import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
    selector: 'app-c-judgement',
    templateUrl: './c-judgement.component.html',
    styleUrls: ['./c-judgement.component.less']
})
export class CJudgementComponent implements OnInit {
    @Output() dataChange = new EventEmitter<object>();
    @Output() onBlur = new EventEmitter<object>();
    word = [
        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
        'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
    ];

    @Input() canEdit;

    _text;
    @Input() data;
    set text(value) {
        this.data.text = value;
    }

    get text() {
        if ( !this.data.text) {
            return '按钮名称';
        } else {
            return this.data.text;
        }
    }

    constructor() { }

    ngOnInit() {

    }

    blur() {
        this.onBlur.emit();
    }

}
